<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
 * 用户上下线
 */
class Invite_Class{
	protected $ci;
	
	private $_db;
	
	function __construct(){
		$this->ci = & get_instance();

		$this->_db = $this->ci->load->database('default',true);
	}

	//经纪人
	public function getAllInvite($start_date="",$end_date="",$master="",$slave=""){
		$where	=	"where 1=1";
		$where	.=   !empty($master) ?" and master ='$master'":"";
		$where	.=   !empty($slave) ?" and slave ='$slave'":"";
		$where	.=   !empty($start_date) ?" and create_time >='$start_date'":"";
		$where	.=   !empty($start_date) ?" and create_time <='$end_date'":"";

		$sql	=	"select * from cfd_invite ".$where;
		$query	=	$this->_db->query($sql);
		$result	=	$query->result_array();
		if (!empty($result)) {
			return $result;
		}
		return	0;
    }
}